﻿@model Wicresoft.SelfService.DAO.OS
@{
    ViewBag.Title = "操作系统名称维护";
    Layout = null;
}

<style type="text/css">
 .hidden
 {
     display:none;
 }
</style>

<script type="text/javascript">
    $(function () {
        $("#saveBtn").click(function () 
        {
            var OSName = $("#OSName").val();
            var check = false;

            if (OSName != "") {
//                $.post("@Url.Action("SearchByOSName", "OSMaintain")", $("#OSForm").serialize(), 
//                function(data){           
//                if(data == "true"){
//                    alert("已存在该选择分类!");
//                }
//                else{
//                    check=true;
//                }
//                });
check=true;
            }
            else
            {
                alert("系统名称不能为空!");
            }
            if (check) {
               $.post("@Url.Action("UpdateOS", "OSMaintain")", $("#OSForm").serialize(), 
               function(data){           
                if(data == "true"){
                    alert("保存成功!");
                    $("#OSName").val("");
                    location.reload(); 
                }
                else{
                    alert("保存失败!")
                }
               });
           }
        });

        $("#deleteBtn").click(function(){
           $.post("@Url.Action("DeleteOS", "OSMaintain")", $("#OSForm").serialize(), 
           function(data){           
            if(data == "true"){
                alert("删除成功!");
                location.reload(); 
            }
            else{
                alert("删除失败!")
            }
           })
        });

    })

</script>

<div class="right_title">操作系统分类维护</div>
<div class="right_box_top ui-icons">
</div>
<div class="right_box_bg">
    <div class="right_box">
         <div style="padding-bottom: 20px;">
            @using (Html.BeginForm("UpdateOS", "OSMaintain", FormMethod.Post, new { @id = "OSForm" }))
            {
                @Html.HiddenFor(model => model.ID)
                <table style="width:100%;">
                    <tbody>
                        <tr>
                            <th align="right" style="width: 20%;">
                               <span>系统名称：</span>
                            </th>
                            <td align="left" style="width: 20%;">
                                @Html.EditorFor(model => model.OSName, new { id = "OSName" })
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <th align="left" style="width: 20%;">
                                
                            </th>
                            <td align="left">
                                <input class="Button1 ui-icons" type="button" id="saveBtn" value="保存" style="margin-left: 45px; margin-top: 20px;" />
                                @*<input class="Button1 ui-icons" type="button" id="deleteBtn" value="删除" style="margin-left: 45px; margin-top: 20px;" />*@
                            </td>
                            <td></td>
                        </tr>
                    </tbody>
                </table>
            }
        </div>
    </div>
</div>
<div class="right_box_down ui-icons">
</div>
